<?xml version="1.0" encoding="UTF-8" ?>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib uri="omitStr" prefix="om"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>培训管理系统</title>
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/common/project/css/reset.css" />
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/common/project/css/style.css" />
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/common/project/css/style2.css" />
<script type="text/javascript" 	src="${pageContext.request.contextPath}/common/project/js/jquery-1.8.3.min.js"></script>
<script type="text/javascript"	src="${pageContext.request.contextPath}/common/project/js/pageExt.js"></script>
<script type="text/javascript">
	$(function(){
		$(".CLASS_fixed").hide();
		$(".CLASS_closeWindowBtn").click(function(){
			$(".CLASS_fixed").hide();
			checkButton();
		});
		$("#resets").click(function(){
			$("#searchClassName").val('');
		});
	});

	function checkUpload(){
		var classUserId=$("input[name='chkSon']:checked").val();
		if(classUserId){
			$('#classUserId').val(classUserId);
			$(".CLASS_fixed").show();
		}else{
			alert("请至少勾选一个培训班！");
		}
		//autoResizeFrame('clazzX');
	}
	//取消按钮路径
	/* function checkButton(){
		var attId=document.getElementById("attachmentId").value;
		var classId=document.getElementById("classId").value;
		if(attId!=""){
			var url="/training/module/trainingstudyinsight/deleteTemp.json";
			var params={
					"attachmentID":attId,
				};
			$.getJSON(url,params,function(data){
				if(data.success){
					window.location.href ='/training/module/trainingstudyinsight/findStudyInsightList.do?searchClassId='+classId;
				}
			});
		}
	} */
	
	String.prototype.trim=function(){
		return this.replace(/(^\s*)|(\s*$)/g, ""); 
	};
	
	//保存按钮
	function checksave(){
		var fileName=document.getElementById("fileName").value.trim();
		var types=fileName.split('.');
		var type=types[types.length-1];
		if($('#submit').attr('use')){
			alert("请勿重复提交");
			return false;
		}
		if(type!='doc'&&type!='docx'){
			alert("仅限上传DOC，DOCX类型文件！");
			return false;
		}else if(fileName==""){
			alert("上传文件不能为空");
			return false;
		}else{
			$('#submit').attr('use',true);
			return true;
		}
	}
</script>
</head>

<body>
	<div class="column" style="height: 100%; display: block; margin: 9px auto 0 auto;width: 70%;">
		<form action="${pageContext.request.contextPath}/module/classuser/findLearningExperienceList.do" method="post" >
			<div class="titleBar">
				<span class="icon"></span><span class="title">学习心得维护</span>
			</div>
			<div class="columnContain" style="width:96%;">
				<!-- <fieldset class="searchBox">
					<legend>查询条件</legend>
					<p style="margin-top: 5px; margin-left: 20px; margin-left: 10px;">
						<span>问卷名称：</span> <input type="text"
							class="inputText" style="width: 200px;" maxlength="50" value="" /> 
					</p>
				</fieldset> -->
				<fieldset class="searchBox" style="height:67px;*height:77px;">
			      <legend>查询条件</legend>
			      <p style="*margin-top:5px; margin-left:20px; *margin-left:5px;">
			        <input type="text" name="searchClassName" id="searchClassName" class="inputText" style="width:20%" value="<c:out value='${resultList.searchClassName }'/>" />
			        <input type="submit" value="查询培训班名称" class="CLASS_btn" style="margin-left: 2%;"/>
			        <input type="button"  id="resets" value="重置" class="CLASS_btn" style="margin-left: 4%;"/>
				    <input type="button" name="button" id="button" value="上传心得" class="CLASS_btn" style="margin-left: 30%;" onclick="checkUpload()">
			      </p>
			    </fieldset>
				<table width="100%" border="0" cellspacing="0" cellpadding="0"
					class="infoTable mt10">
					<col align="left"/>
					<col align="center"/>
					<col align="center"/>
					<col align="center"/>
					<col align="center"/>
					<col align="center"/>
					<col align="center"/>
					<col align="center"/>
					<col align="center"/>
					<tr>
						<th ></th>
						<th  class="first">培训班名称</th>
						<th >主办单位</th>
						<th >班级类型</th>
						<th >开班时间</th>
						<th >结班时间</th>
						<th >附件名称</th>
						<th >附件大小</th>
						<th >下载</th>
						<th >删除</th>
					<c:if test="${empty resultList.resultList}">
						<tr>
							<td  style="text-align: center;font-size: 28px;" colspan=10><br />暂无数据<br /><br /></td>
						</tr>
					</c:if>
					<c:forEach items="${resultList.resultList}" var="info">
						<tr class="even"  style="border: 1px #d2e9f4 solid;">
							 <%-- <td align="left"
								title="<c:out value="${remind.questionnaireName}" />"><om:omit
									stringValue="${remind.questionnaireName}" showLength="38" --%>
							<td><input type="radio" name="chkSon" value="${info.classUserId}"></td>
							<td title="<c:out value='${info.className }'/>">
								<om:omit stringValue="${info.className}" showLength="20"></om:omit>
							</td>
							<td style="text-align: center;"><c:out value='${info.sponsorName }'/></td>
							<td style="text-align: center;"><c:out value='${info.classType }'/></td>
							<td style="text-align: center;">
								<fmt:formatDate value="${info.beginDate }" pattern="yyyy-MM-dd"/>
							</td>
							<td style="text-align: center;">
								<fmt:formatDate value="${info.endDate }" pattern="yyyy-MM-dd"/>
							</td>
							<td style="text-align: center;"><c:out value='${info.fileName }'/></td>
							<td style="text-align: center;"><c:out value='${info.fileSize }'/></td>
							<td style="text-align: center;">
								<c:choose>
								<c:when test="${empty info.attachmentID}">
								</c:when>
								<c:otherwise>
									<a title="下载" href="${pageContext.request.contextPath}/components/attachment/download.do?attachmentID=${info.attachmentID}" target="">
										<img src="${pageContext.request.contextPath}/common/project/images/down.png" alt="下载" ></a>
									<%-- <a href="${pageContext.request.contextPath}/components/attachment/download.do?attachmentID=${info.attachmentID}" target="">下载</a> --%>
								</c:otherwise>
							</c:choose>
							</td>
							<td style="text-align: center;">
								<c:choose>
								<c:when test="${empty info.attachmentID}">
								</c:when>
								<c:otherwise>
									<%-- <a href="${pageContext.request.contextPath}/components/attachment/download.do?attachmentID=${info.attachmentID}" target="">下载</a> --%>
									<a title="删除" href="javascript:if(confirm('是否确认删除?'))location='${pageContext.request.contextPath}/module/trainingclass/deleteAttachment.do?attachmentIds=${info.attachmentID}&classUserIds=${info.classUserId}'">
										<img src="${pageContext.request.contextPath}/common/project/images/delete.png" alt="删除" ></a>
								</c:otherwise>
							</c:choose>
							</td>
						</tr>
					</c:forEach>
				</table>
				<div class="page">
					<input type="hidden" name="page" value="1" /> <span>第${resultList.page }页</span>
					<span>共${resultList.maxPage }页</span> <span>共${resultList.count }条数据</span>
					<a href="javascript:pageHandle(1)">首页</a> <a
						href="javascript:pageHandle(${resultList.page-1 })">上一页</a> <a
						href="javascript:pageHandle(${resultList.page+1 })">下一页</a> <a
						href="javascript:pageHandle(${resultList.maxPage })">末页</a> <span>第<input
						name="goTo" type="text" id="goTo" size="2" class="input_Text"
						value="${resultList.page }" /> 页
					</span> <input type="button" name="button" id="button"
						onclick="pageHandleGoTo('goTo')" value="跳转" class="subMitBtn" />
				</div>
			</div>
		</form>
		
		<div class="CLASS_fixed" style="display: block;">
		        <div class="CLASS_panel CLASS_window mCenter" style="height:auto;">
		            <div class="CLASS_titleBar">
		                <h4>上传学习心得</h4>
		                <span class="CLASS_closeWindowBtn"><a href="#"><img src="${pageContext.request.contextPath}/common/project/images/closeWindowBtn.png" alt="关闭" width="20" height="20"></a></span> 
		            </div>
		            <div class="CLASS_dateFrom">
		            	<form enctype="multipart/form-data" method="post" action="${pageContext.request.contextPath}/module/trainingclass/uploadExperience.do" >请选择一个文件:
							    <input type="file" name="uploadFile" id="fileName"/>
							    <br/><br/>
							    <p style="color: red;">* 仅限上传DOC，DOCX类型文件</p>
							    <br/><br/>
							    <input type="hidden" id="classUserId" name="classUserId"></input>
							    <input id="submit" type="submit" value="确 定" class="CLASS_btn2" style="margin-right:30px;" onclick="return checksave()">
		                        <input type="button" name="button3" id="button3" value="取 消" class="CLASS_cancleBtn" onclick="javascript:$('span.CLASS_closeWindowBtn').click();">
		                  </form>
		                </div>
		            </div>
		        </div>
	</div>


	<%-- <!--footer-->
<iframe align="middle" src="${pageContext.request.contextPath}/portal/project/homePage/footer.jsp"
	width="100%" height="70" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0"/>
</iframe> --%>
</body>
</html>
